<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改施工合同')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-constructContract-edit" th:object="${arcConstructContract}">
            <input name="id" th:field="*{id}" type="hidden">

            <div class="form-group">    
                <label class="col-sm-3 control-label">工地id：</label>
                <div class="col-sm-8">
                   <!-- <input name="projectId" th:field="*{projectId}" class="form-control" type="text">-->
                    <select name="projectId" class="form-control m-b" th:with="type=${projects}">
                        <option th:each="item : ${type}" th:text="${item.projectName}" th:value="${item.id}" th:field="*{projectId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">建设单位id：</label>
                <div class="col-sm-8">
                    <input name="builderId" th:field="*{builderId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">施工单位id：</label>
                <div class="col-sm-8">
                    <input name="labourId" th:field="*{labourId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">合同金额：</label>
                <div class="col-sm-8">
                    <input name="contractAmount" th:field="*{contractAmount}" class="form-control" type="text">
                    <span style=" position: absolute; top: 1%; right: 6%;color: #adadad; display: table-cell;white-space: nowrap; padding: 7px 10px;">万元</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">支付方式：</label>
                <div class="col-sm-8">
                    <input name="payMethod" th:field="*{payMethod}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">拖欠工程款金额：</label>
                <div class="col-sm-8">
                    <input name="paymentArrears" th:field="*{paymentArrears}" class="form-control" type="text">
                    <span style=" position: absolute; top: 1%; right: 6%;color: #adadad; display: table-cell;white-space: nowrap; padding: 7px 10px;">万元</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">计划支付日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="planPayDate" th:value="${#dates.format(arcConstructContract.planPayDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_status')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "architecture/constructContract";
        $("#form-constructContract-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-constructContract-edit').serialize());
            }
        }

        $("input[name='planPayDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>